package com.yingxin.yxerp.module.inform.vo.req;

import cn.hutool.core.collection.CollectionUtil;
import com.yingxin.yx.framework.commons.constant.CommonConst;
import com.yingxin.yx.framework.commons.dto.PageIn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 通知公告-公告
 * @author zhuchangjie
 * @since 2021-12-21
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="NoticeQueryVo对象", description="通知公告-公告")
public class NoticeQueryVo extends PageIn {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标题 ")
    private String title;

    @ApiModelProperty(value = "公告类型id ")
    private String noticeTypeId;

    @ApiModelProperty("归属user id")
    private String userId;

    @ApiModelProperty(value = "read 含已读")
    private List<String> checkedList;

    public String getRead() {
        return CollectionUtil.isEmpty(checkedList) ? null : (checkedList.contains("read") ? CommonConst.TRUE : null);
    }

}
